package example.com.zyfypt_618zgm.model;


import retrofit2.Call;

import example.com.zyfypt_618zgm.bean.LoginBean;
import example.com.zyfypt_618zgm.iface.Loginiface;
import example.com.zyfypt_618zgm.service.LoginService;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by 小茗同学 on 2017/6/1.
 */

public class LoginModel implements Loginiface {
    private Retrofit retrofit;
    private String BASEURL="http://amicool.neusoft.edu.cn/";
    public LoginModel() {
        retrofit =new Retrofit.Builder().baseUrl(BASEURL).addConverterFactory(GsonConverterFactory.create()).build();
    }

    @Override
    public Call<LoginBean> getResult(String username, String password) {
        LoginService loginservice =retrofit.create(LoginService.class);
        return loginservice.login(username,password);
    }
}
